
Public Class FdapPortService

    Public Shared Function GetCarPort(ByVal pid As String, ByVal portno As Integer) As Boolean

        Dim strSql As String = String.Format("select count(*) from fdapportinfo where projectID ='{0}' and netid ='{1}' and portno={2} ", pid, 1, portno)


        Dim obj As Object
        obj = TBCC.UtilityMobile.SqlHelper.ExecuteScalar(strSql, Nothing)

        If obj Is Nothing OrElse IsDBNull(obj) Then
            Return True
        End If

        If CInt(obj) > 0 Then
            Return False
        Else
            Return True
        End If

    End Function

    Public Shared Function GetFDAPCarPort(ByVal pid As String, ByVal portno As Integer) As Integer

        Dim strSql As String = String.Format("select fdapPortNo from fdapportinfo where projectID ='{0}' and netid ='{1}' and portno='{2}' ", pid, 1, portno)


        Dim obj As Object
        obj = TBCC.UtilityMobile.SqlHelper.ExecuteScalar(strSql, Nothing)

        If obj Is Nothing OrElse IsDBNull(obj) Then
            Return 0
        Else
            Return CInt(obj)
        End If

    End Function

    



End Class
